]> dgit.raspbian.org Git - gnome-shell.git/commit
screencastService: Add rate control to VA-API H.264 pipelines
authorMikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Sun, 12 Apr 2026 13:14:01 +0000 (18:14 +0500)
committerMarge Bot <marge-bot@gnome.org>
Sun, 19 Apr 2026 11:26:56 +0000 (11:26 +0000)
commit7b6d39c204f2e552af3230c189ef2239e062f995
tree316c8fa6678cee92853809685f009d699f0f20c0
parent187f27837a331675d322a2065745dfeab4ec501e
screencastService: Add rate control to VA-API H.264 pipelines

The vah264enc and vah264lpenc pipelines do not specify any rate control
parameters, causing the encoder to use its default bitrate. At 4K this
results in ~12 Mbit/s recordings — roughly 18x larger than the VP8
software fallback (~630 kbit/s) with no visible quality benefit for
typical screencast content.

All other pipelines in the PIPELINES array constrain quality explicitly:
openh264enc uses qp-max=26/qp-min=26, vp8enc uses max-quantizer=17 and
buffer-size=20000. Only the two VA-API pipelines are left unconstrained.

Add rate-control=vbr bitrate=2048 target-percentage=50 to both VA-API
pipelines. This produces ~1 Mbit/s average / 2 Mbit/s peak, which is
comparable to what the other encoders produce and works across both AMD
(which lacks CQP) and Intel VA-API implementations.

Before (4K, 5s recording): 11688 kb/s, 7.2 MB
After  (4K, 5s recording):  2472 kb/s, 1.6 MB

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/9165
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4171>
js/dbusServices/screencast/screencastService.js